package com.shfl.app;

import javafx.application.Application;
import javafx.fxml.FXMLLoader;
import javafx.scene.Parent;
import javafx.scene.Scene;
import javafx.scene.image.Image;
import javafx.stage.Stage;
import stock.Stock;

public class LoginMain extends Application {


    public static void main(final String[] args) {
        Application.launch(args);
    }

    @Override
    public void start(Stage primaryStage) throws Exception{

        Stock.LOGIN_STAGE = primaryStage;
        Parent root = FXMLLoader.load(getClass().getResource("/fxml/login.fxml"));
        Stock.LOGIN_STAGE.setTitle("图片识别");
        Stock.LOGIN_STAGE.getIcons().add(new Image("/path/fl.png"));
        Stock.LOGIN_STAGE.setScene(new Scene(root));
        Stock.LOGIN_STAGE.show();
    }

    public void  showWindow() throws Exception {
        start(Stock.LOGIN_STAGE);
    }

    @Override
    public void stop() throws Exception {
        Stock.LOGIN_STAGE.hide();
    }
}
